package com.lifeng.controller;

import com.lifeng.bean.User;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;

/**
 * Created by lifeng on 2018/4/13.
 * 服务提供方
 */
@RestController
public class UserProviderCotroller {
    private static final Logger log = LoggerFactory.getLogger(UserProviderCotroller.class);

    /**@GetMapping 相当于 get请求 */
    @GetMapping("/user/{id}")
    public Object findById(@PathVariable String id){
        User user = new User();
        user.setId(id);
        user.setName("张洒");
        user.setBirthday(new Date());
        log.info("新的请求到达");
        return user;
    }

}
